<%@ page import="cn.edu.lingnan.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Objects" %>
<%@ page import="cn.edu.lingnan.pojo.Club" %>
<%@ page language="java" isThreadSafe="true" pageEncoding="utf8" %>
<html lang="en">
<head>
    <title>学生管理</title>
    <!-- 引入Vue.js -->
    <script src="../../ststic/js/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../../ststic/js/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="../../ststic/js/element-ui/lib/index.js"></script>
    <script src="../../ststic/js/main.js"></script>
</head>
<body>
<div id="app">
    <el-container>
        <el-header>
            <el-header >
                <div style="float: right; font-size: 15px">
                    <el-dropdown>
                        <i class="el-icon-setting" style="margin-right: 10px"></i>
                        <el-dropdown-menu>
                            <el-dropdown-item><a href="/loginout" style="text-decoration: none">
                                退出</a></el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                    <span>&nbsp</span>
                    管理员
                </div>
                <span>岭南师范学院计算机与智能教育学院社团管理系统</span>
            </el-header>
        </el-header>
        <el-container>
            <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
                <el-menu :default-openeds="['1', '2']">
                    <el-submenu index="1">
                        <template slot="title"><i class="el-icon-edit-outline"></i>管理</template>
                        <el-menu-item index="1-1">
                            <i class="el-icon-user-solid"></i><el-link href="/student/queryAllStu">学生管理</el-link>
                        </el-menu-item>
                        <el-menu-item index="1-2">
                            <i class="el-icon-paperclip"></i><el-link onclick="location.reload()">社团管理</el-link>
                        </el-menu-item>
                        <el-menu-item index="1-3">
                            <i class="el-icon-suitcase"></i><el-link href="/position/queryAllPost">职位管理</el-link>
                        </el-menu-item>
                    </el-submenu>
                    <el-submenu index="2">
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-main>
                <form id="form" action="updateClub">
                    <table class="el-table" >
                        <tr>
                            <td>社团编号</td>
                            <td>社团名称</td>
                            <td>备注</td>
                            <td>操作</td>
                        </tr>
                        <%
                            List<Club> allClub = (List<Club>) session.getAttribute("ClubList");
                            String cid = request.getParameter("cid");
                            for (Club club : allClub) {
                                if (club.getCid().equals(cid)){
                        %>
                        <tr style="margin: auto;padding: 2px">
                            <td><%=club.getCid()%><input type="hidden" name="cid" value="<%=club.getCid()%>">
                            </td>
                            <td><input type="text" name="cname" value="<%=club.getCname()%>">
                            </td>
                            <td><input type="text" name="cflag" value="<%=club.getCflag()%>">
                            </td>
                            <td>
                                <el-button type="primary" @click="submit">确定</el-button>
                            </td>
                        </tr>
                        <%
                                }
                            }
                        %>
                    </table>
                </form>
            </el-main>
        </el-container>
    </el-container>
</div>
</body>
<script>
    new Vue({
        el:"#app",
        data(){
            return{

            }
        },
        created(){

        },
        methods:{
            submit(){
                document.getElementById("form").submit();
            }
        }
    })
</script>
<style>
    .el-header {
        background-color: #B3C0D1;
        color: #333;
        text-align: center;
        line-height: 60px;
    }
    .el-aside {
        background-color: #D3DCE6;
        color: #333;
        text-align: center;
        line-height: 200px;
        width:200px;

    }
    .el-main {
        background-color: #E9EEF3;
        color: #333;
        text-align: center;
        line-height: 160px;
    }
    body > .el-container {
        margin-bottom: 40px;
    }
    body{
        padding: 0;
        margin: 0;
    }
</style>
</html>